<% 
DIRECTIVE SAFE_OUTPUT_OPEN;
var headContent = {
	include("/pages/template/head.html"){}
%>
<script type="text/javascript">
    var um;
    $(document).ready(function(){
        um = UM.getEditor('editor',{
            initialFrameHeight:400  //初始化编辑器高度,默认320
        });
    });
	var oper = {
		save:function(id){
			if(!validForm()) {
				return false;
			}
			id = id || '0';
			var url = 'admin/tuan/save/'+id;
			form1.action = url;
			form1.submit();
			return true;
		}	
	};
</script>
<% include("/pages/includes/umeditor.html"){} %>
<% include("/pages/includes/my97.html"){} %>

<%
};
var bodyContent = {
%>
<form name="form1" action="" method="post" class="form-horizontal"
		role="form" >
	<input type="hidden" name="model.id" value="${model.id}" />
	<table class="table">
		<%  // 列表头部%>
								<tr>
					<td>团购名称</td>
					<td>
					<input class="form-control" type="text" name="model.title" value="${model.title }"  />
											</td>
				</tr>
								<tr>
					<td>主办方</td>
					<td>
					<input class="form-control" type="text" name="model.sponsor" value="${model.sponsor }"  />
											</td>
				</tr>
								<tr>
					<td>主办方电话</td>
					<td>
					<input class="form-control" type="text" name="model.sponsor_phone" value="${model.sponsor_phone }"  />
											</td>
				</tr>
								<tr>
					<td>最大召集人数</td>
					<td>
					<input class="form-control" type="text" name="model.max_persons" value="${model.max_persons }"  valid='vnum' validname='最大召集人数'  />
											</td>
				</tr>
								<tr>
					<td>每批次人数</td>
					<td>
					<input class="form-control" type="text" name="model.per_persons" value="${model.per_persons }"  valid='vnum' validname='每批次人数'  />
											</td>
				</tr>
								<tr>
									<td>简介图片
										<% if(!strutil.isEmpty(model.summary_img)||!strutil.isEmpty(model.image_net_url)){ %>
										<a href="${flyfox.getImage(model)}" target="_blank" style="text-decoration:none;">
											<img alt="图片" title="点击浏览" src="${flyfox.getImage(model)}" width="40" height="40">
										</a>
										<% } %></td>
									<td>
										<input type="file" accept="image/*" class="form-control" name="model.summary_img" />
									</td>
				</tr>
								<tr>
					<td>活动内容</td>
					<td>
						<div>
							<script id="editor" type="text/plain" name="model.content"
									style="width: 98%; height: 320px;">${model.content}</script>
						</div>
											</td>
				</tr>
								<tr>
					<td>开始时间</td>
					<td>
					<input class="form-control" type="text" name="model.start_time" value="${model.start_time }"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
											</td>
				</tr>
								<tr>
					<td>结束时间</td>
					<td>
					<input class="form-control" type="text" name="model.end_time" value="${model.end_time }"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
											</td>
				</tr>
				<tr>
				<td>团状态</td>
				<td>
                            <select name="model.status" class="form-control" >
                            ${flyfox.dictSelect('tuanStatus' , model.tuanStatus!'11')  }
                            </select>
				</td>
				</tr>
	</table>
	
	<div style="height: 50px;clear: both;">&nbsp;</div>
	<nav class="navbar navbar-default navbar-fixed-bottom">
	  <div class="container" style="padding: 5px 0px 5px 0px;text-align: center;">
		<button class="btn btn-primary" onclick="return oper.save(${model.id});">保 存</button>
		<button class="btn btn-default" onclick="closeIframe();return false;">关 闭</button>
	  </div>
	</nav>
</form>
<%}; %>

<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%}
DIRECTIVE SAFE_OUTPUT_CLOSE; 
%>